<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>用户中心-修改密码</title>
    <link rel="stylesheet" href="css/font-awesome.min.css" />
    <link rel="stylesheet" href="css/font-awesome-ie7.min.css" />
    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/admin.css"/>
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <![endif]-->
    <!--[if lt IE 10]>
    <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/jquery-placeholder/2.0.8/jquery.placeholder.min.js"></script>
    <![endif]-->
</head>
<body>
<!-- header start -->
<div id="header">

</div>
<!-- header end -->
<!-- usercenter start -->
<div class="usercotent">
    <!-- left start -->
    <div id="center-left"></div>
    <!-- left end -->
    <!-- order right start -->
    <div class="usercotentr floatr">
        <div class="user-tit" style="margin-bottom:10px">
            <h3>修改密码</h3>
        </div>


        <!-- password start -->
        <div class="user-con">

            <div class="row">
                <div class="col-md-4 col-md-offset-4">
                    <div class="moe-password">

                        <div class="form-group">
                            <label for="exampleInputEmail1">原密码</label>
                            <input id="origPassword" type="password" class="form-control wh">
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">新密码</label>
                            <input id="newPassword" type="password" class="form-control wh">
                        </div>
                        <!--<div class="form-group">-->
                            <!--<label for="exampleInputPassword1">确认密码</label>-->
                            <!--<input id="newPassword1" type="password" class="form-control wh">-->
                            <!--<span>新密码不一致</span>-->
                        <!--</div>-->
                        <button id="modify" type="submit" class="btn btn-primary">确&nbsp;&nbsp;&nbsp;&nbsp;定</button>

                    </div>
                </div>

            </div>
        </div>

        <!-- password end -->
    </div>
    <div class="clear"></div>
    <!-- order right end -->
</div>

<!-- usercenter end -->

<!-- footer start -->
<div class="footer">
    <div class="bot">
        <p style="padding-top: 10px; text-align: center">Copyright (C) 都能印 2014-2016, all Rights Reserved | 豫ICP备14024464号-1 | 增值电信业务经营许可证：豫B2-20150019</p>
        <p class="authentication" style="padding-bottom: 10px; padding-top: 10px;">
            <img src="img/footer1.png" alt="">
            <img src="img/footer2.png" alt="">
            <img src="img/footer3.png" alt="">
            <img src="img/footer4.png" alt="">
            <img src="img/footer5.png" alt="">
        </p>

    </div>
</div>
<!-- footer end -->
<script src="js/jquery.min-1-11-3.js"></script>
<script src="js/widget/admin.js"></script>

<script src="js/sidebar-menu.js"></script>
<script>
    $(function(){

        initSideAccMenu("企业资料管理", "账号密码修改");
    });
    $("#newPassword1").keyup(function () {

    })
    //修改密码
    $("#modify").click(function () {
        /* Act on the event */
        if ($("#newPassword").val() == "" || $("#origPassword").val() == "") {
            alert("信息不能为空");
            return;
        }
        var url = "apis/user/changeloginuserpassword";
//        var data =
//        {
//            "params": {
//            "origpsw": $("#origPassword").val(),
//                "newpsw":  $("#newPassword").val()
//        }
//        }

        $.ajax({
            url: url,
            type: 'post',
            data: {
                oldPassword:$("#origPassword").val(),
                newPassword:$("#newPassword").val()
            },
            dataType: 'json',
            async: false,
            contentType : 'application/json',
            success: function (data) {

                if (data.httpCode == 200) {
                    alert("密码修改成功，将在下次登录时生效");
                    window.top.location.href = "login.html";
                } else {
                    alert(data.msg);
                }

            }

        });
    });

</script>
</body>
</html>